$(function(){
	//页面加上查询条件
	showCondition(true);
	//正在加载
	paramTabPage[tabId]= $("#tabContent > .tab-pane.active").data();
	
	var depCode = paramTabPage[tabId].depCode;
	var depName = paramTabPage[tabId].depName;
	$("#" + tabId + " #depCode").val(depCode);
	$("#" + tabId + " #depName").val(depName);
	$("#" + tabId + " #deptarget").html('<i class="fa fa-file-text-o" ></i>' + depName + "病组指标")
	$("#" + tabId + " #depalltarget").html('<i class="fa fa-file-text-o" ></i>' + depName + "科室指标")
	
	var depGroupCode = paramTabPage[tabId].depGroupCode;
	$("#" + tabId + " #depGroupCode").val(depGroupCode);		
	var depGroupName = paramTabPage[tabId].depGroupName;
	$("#"+tabId+" #depGroupName").val(depGroupName);
	
	getQuotas("departmentDisAdrgMonitor_1", loadData_1, "departmentadrghosp-ul");
	
	function loadData_1(totalQuota){
		/* 全院指标 (1.Hosp 2.All) 
		参数：1.查询类型2.查询全部 数据3.查询的指标以及页签名4.此部分所加载的div的id，3.div下面的ul*/
		loadDepartmentAllQuota("mdc",totalQuota,"departmentAdrgQuotasTopId","departmentadrghosp-ul");
		/*
		加载下面的的div
		参数：1.查询指标2.表格头部显示的名字3.布局所在的页面4。div下面的ul*/
		loadDepartmentQuota(totalQuota,"ADRG","departmentAdrgQuotasId","departmentadrg-ul");		
		/*	为下半部分加载数据 
		参数：3.表格第一列加载链接4.表格操作中的链接*/
		loadDepartmentQuotaData(totalQuota,"adrg","loadAdrgToDrgs","loadAdrgToDep");
	}
});


function loadAdrgToDrgs(code,desc){
	var param = jQuery.extend(true,{},paramTabPage[tabId]);
	param.adrgCode = code;
	openTab('/pages/department/departmentDisDrgMonitor.jsp', code+'|DRGs','adrgtodrgs'+code, 'adrgtodrgs'+code,param);

}
function loadAdrgToDep(code,desc){
	var param = jQuery.extend(true,{},paramTabPage[tabId]);
	param.adrgCode = code;
	openTab('/pages/department/departmentDisDepMonitor.jsp',code+'|科室','adrgtodep'+code,'adrgtodep'+code,param);

}